import EventDispatcher from "./EventDispatcher.js";

export default class Player extends EventDispatcher {
  constructor({ name, age, location }) {
    super({ name, age, location });
  }

  shoot() {
    this.dispatchEvent({
      type: 'shoot',
      message: 'three points!',
    });
  }

  toString() {
    return `${super.toString()}, ${this.position}`;
  }
}